﻿<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="Moonwish.Foundation.Views.ValueObjects.ValueObjectView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:vm="clr-namespace:Moonwish.Foundation.ViewModels.ValueObject"
             xmlns:Core="clr-namespace:Moonwish.Core;assembly=Moonwish.Silverlight.Core" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <Core:ObservableCommand x:Name="EditCommand" Value="{Binding EditCommand, Mode=TwoWay}"/>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <sdk:DataGrid x:Name="DatagridValueObject" Grid.Row="1" Grid.Column="1" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemsSource="{Binding Data, Mode=TwoWay}" IsReadOnly="True" SelectionMode="Single" AutoGenerateColumns="False" Margin="0, -1, 0, 0" >
            <sdk:DataGrid.Columns>
                <sdk:DataGridTemplateColumn Header="名称" MinWidth="140">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <HyperlinkButton Content="{Binding Name}" 
                                             Command="{Binding Value, Source={StaticResource EditCommand} }" 
                                             CommandParameter="{Binding}"
                                             Margin="4, 0, 0, 0" VerticalAlignment="Center"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTextColumn Header="编码" Binding="{Binding Code}" MinWidth="80"/>
                <sdk:DataGridTextColumn Header="序号" Binding="{Binding OrderNo}" MinWidth="80"/>
                    <sdk:DataGridTextColumn Header="状态" Binding="{Binding StatusName}" MinWidth="80"/>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
    </Grid>
</UserControl>
